<?
session_start();
include('admin/bd.php');
Conectar();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Bidetoday - Add Freshers to your life </TITLE>
  <META NAME="Generator" CONTENT="DILAPER">
  <META NAME="Author" CONTENT="Power by Sebastian Costa - Design: Nadia De Cinti">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
  <link href="style.css" rel="stylesheet" type="text/css">
  <script src="js/botonera.js" type="text/javascript"></script>
  <script type="text/javascript" src="js/pngfix.js"></script>
 </HEAD>

 <BODY topmargin="0">
<center>

<table width="990" height="100%" cellspacing="0" cellpadding="0" class="fondo" border="0">
	<tr>
		<td width="990" height="100%" align="center" valign="top">
<?include('inc/head.php');?>
	<table width="740" cellspacing="0" cellpadding="0" border="0" valign="top">
		<tr>
			<td valign="top" align="center">
<?include('inc/menu_head.php');?>
			</td>
		</tr>
		<tr>
			<td valign="top" align="center">
	<table width="740" cellspacing="0" cellpadding="0" border="0" valign="top" class="tabla_principal_up">
		<tr>
			<td align="left">
<?include('inc/menu_search.php');?>
			</td>
		</tr>
		<tr>
			<td class="fondo_titulo" height="27" align="left"><!-- titulo de la pantalla -->
<div style="margin-left: 25px;">Sopping Cart</div>			
			</td>
		</tr>
		<tr>
			<td align="center">
<!-- contenido -->
<table border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="140" valign="top">
<!-- botonera home -->
<?include('inc/menu_products.php');?>
<!-- fin botonera fin -->
		</td>
		<td width="40" class="sombra_left">
&nbsp;
		</td>
		<td width="500" height="405" class="tabla_central" align="center" valign="top">
	<div style="margin: 5px; margin-top: 8px;">
<table width="490" border="0" cellspacing="0" cellpadding="0" class="tabla_productos">
	<tr>
		<td width="25%" height="20" align="center">
<div style="margin-bottom: 1px;">Item</div>
		</td>
		<td width="25%" align="center">
<div style="margin-bottom: 1px;">Unit Price</div>
		</td>
		<td width="25%" align="center">
<div style="margin-bottom: 1px;">Data</div>
		</td>
		<td width="25%" align="center">
<div style="margin-bottom: 1px;">Total</div>
		</td>
	</tr>
</table>
<table width="480" border="0" cellspacing="0" cellpadding="0" class="txt_productos" bgcolor="#ffffff" style="border: 1px solid #000000; border-top: 0px;">
	<tr><td colspan="4" height="20"></td></tr>
<?
$cuantos='0';
$result=mysql_query("SELECT * FROM carrito WHERE id_session='".session_id()."'");
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
?>
	<tr>
		<td width="25%" height="30" align="center" style="border-right: 1px solid #000000;">
<?if(file_exists('img_products/'.$row[code].'-1_c.jpg')){?>
<img src="img_products/<?echo $row[code]?>-1_c.jpg"><br><?}?>
<?echo$row[nombre];?><br>
<?echo$row[modelo];?><br>
		</td>
		<td width="25%" align="center" style="border-right: 1px solid #000000;">
<?
$price_d= substr($row[precio], 0, strlen($row[precio]) -2);
$price_c= substr($row[precio], -2, 2);
?>
<b>$<?echo$price_d.'.'.$price_c?></b><br>
		</td>
		<td width="25%" align="left" style="border-right: 1px solid #000000;">
<div style="margin-left: 5px">
QTY:&nbsp;&nbsp;<?echo$row[cantidad];?><br>
Shape:&nbsp;&nbsp;<?echo$row[forma];?><br>
Color:&nbsp;&nbsp;<?echo$row[color];?><br></div>
		</td>
		<td width="25%" align="center">
<?
$total=($row[precio]*$row[cantidad]);
$total_t=$total_t+$total;
?>
<?
$total_d= substr($total, 0, strlen($total) -2);
$total_c= substr($total, -2, 2);
?>
<b>$<?echo$total_d.'.'.$total_c;?></b><br>
<hr width="50%">
<a href="acciones/cart_delete.php?id=<?echo$row[id];?>" style="color: red;">delete</a>
		</td>
	</tr>
	<tr><td colspan="4" height="20"></td></tr>
<?$cuantos++;}?>
</table>
<table width="490" border="0" cellspacing="0" cellpadding="0" class="tabla_productos">
	<tr>
		<td width="25%" height="20" align="right">
<?
$total_t_d= substr($total_t, 0, strlen($total_t) -2);
$total_t_c= substr($total_t, -2, 2);
$_SESSION[subtotal]=$total_t_d.'.'.$total_t_c;
$_SESSION[cuantos]=$cuantos;
?>
<div style="margin-bottom: 2px; margin-right: 50px;"><b>$<?echo$total_t_d.'.'.$total_t_c;?></b></div>
		</td>
	</tr>
</table>
<br>
<form name="code_promotion" method="POST" action="">
	<table width="490" border="0" class="txt_productos">
		<tr>
			<td valign="middle" align="right" class="tabla_code_promotion" height="38">
<div style="margin-right: 20px; margin-bottom: 1px;">ENTER PROMOTION CODE <input type="code_promotion" size="6">&nbsp;&nbsp;<input title="code_promotion" alt="code_promotion" src="img/btn_code_promotion-trans.png" type="image" onClick="document.code_promotion.action='acciones/code_promotion.php'; document.code_promotion.submit()"></div>
			</td>
		</tr>
	</table>
</form>
<br>
<table width="490" border="0" cellspacing="0" cellpadding="0" >
	<tr>
		<td align="right">
	<table width="200" border="0">
		<tr>
			<td align="right">
<?
if($_SESSION[carrito]=='yes'){?>
<form name="cart" method="POST" action="">
<input title="Payment" alt="Payment" src="img/btn_continue-trans.png" type="image" onClick="document.cart.action='payment.php'; document.cart.submit()">&nbsp;&nbsp;&nbsp;&nbsp
</form>
<?}else{
$check='';
}?>
			</td>
		</tr>
	</table>
		</td>
	</tr>
</table>
<br>
	</div>
		</td>
		<td width="40" class="sombra_right">
&nbsp;
		</td>
	</tr>
	<tr>
		<td colspan="4" align="right">
		<div style="margin-right: 10px;">
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="60" height="59" class="esq_left"></td>
			<td class="sombra_down" width="451"></td>
			<td width="60" class="esq_right"></td>
		</tr>
	</table>
		</div>
		</td>
	</tr>
</table>
<!-- fin contenido -->
			</td>
		</tr>
		<tr>
			<td align="center" height="40" valign="top" align="center" class="tabla_foot">
<?include('inc/menu_foot.php');?>
			</td>
		</tr>
	</table>
			</td>
		</tr>
		<tr>
			<td valign="top" align="center" class="tabla_principal_down" height="10">
			</td>
		</tr>
	</table>
		</td>
	</tr>
</table>
<br>
</center>
 </BODY>
</HTML>
<?Desconectar();?>